package com.tengju.bff.interfaces.covercharge.constant;

/**
 * 身份枚举
 *
 * @author fwy
 */
public enum CooperationEnum {

    PERSONAL("person","个人"),
    REGISTSOHO("regist_soho","注册个体户"),
    CERTIFIEDINDIVIDUAL("certified_individual","自认证个体户"),
    CERTIFIEDBUSINESS("certified_business","自认证企业");

    private String code;
    private String desc;

    CooperationEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode(){
        return this.code;
    }
    public String getDesc(){
        return this.desc;
    }

    public static CooperationEnum getCooperationDesc (String code){
        for(CooperationEnum cooperation : (CooperationEnum.values())){
            if(cooperation.getCode().equals(code)){//如果传入的code与此枚举code相同，则返回此枚举
                return cooperation;
            }
        }
        return null;
    }

}
